﻿
Imports BUS
Public Class frmRestore : Inherits DevComponents.DotNetBar.Office2007Form

    Private m_strFilePath As String
    Public Property FilePath() As String
        Get
            Return m_strFilePath
        End Get
        Set(ByVal value As String)
            m_strFilePath = value
        End Set
    End Property


    Public Sub PhucHoi()
        If New CBackupRestoreBUS().Restore(FilePath) Then
            LabelX1.Text = "Phục hồi thành công <br /> Khởi động lại chương trình."
        Else

            LabelX1.Text = "Phục hồi thất bại."
        End If
    End Sub


    Private Sub frmRestore_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        Me.DialogResult = Windows.Forms.DialogResult.OK
    End Sub

    Private Sub frmRestore_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'LabelX1.Text = "Đang phục hồi . . . "
        Application.DoEvents()
    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Me.Close()
    End Sub

    Private Sub frmRestore_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
        Application.Restart()
    End Sub
End Class